#!/user/bin/python3
# @Author:  LSY
# @Date:    2020/11/8
from app.models.bo.hanfan.hanfan_model_input_bo import HanFanModelInputBO
from app.services.models.base_model import BaseModel
from app.services.models.pickle_model import PickleModel
from flask import current_app
import pandas as pd
import numpy as np
from app.utils.constant import HanFanStatus


class HanfanVModelV2(BaseModel):

    def __init__(self):
        super().__init__(model_name="hanfan_v_model_v2")

    def process(self, input):
        try:
            a1 = input.get("CG_LT_GL_GL04_Tie_V",0)
            a2 = input.get("CG_LT_GL_GL04_Tie_V_1",0)
            y_V = a1 * 0.3 + a2 * 0.7
            return round(y_V, 3)
        except Exception as e:
            current_app.logger.info(e,exc_info=1)
            return 0


hanfan_v_model = HanfanVModelV2()
